package com.hqx.processcontrol;

import java.util.Scanner;

/**
 * @author hqx
 * @version 2021-06-17 v1.0
 */
public class SwitchTest {
    static Scanner sc = new Scanner(System.in);
    public static void main(String[] args) {
//        test();
        test2();
    }


    public static void test() {

        System.out.println("请输入季节:");
        String season = sc.nextLine();
        switch (season) {
            case "spring":
                System.out.println("春暖花开");
                break;
            case "summer":
                System.out.println("夏日炎炎");
                break;
            case "autumn":
                System.out.println("秋高气爽");
                break;
            case "winter":
                System.out.println("冬雪皑皑");
                break;
            default:
                System.out.println("季节输入错误!");
                break;
        }
    }

    /**
     * 使用 switch 把小写类型的 char型转为大写。只转换 a, b, c, d, e. 其它的输
     * 出 “other”。
     */
    public static void test2() {
        System.out.println("请输入任意字符");
        String word = sc.nextLine();
        char c = word.charAt(0);
        switch (c) {
            case ('a'):
                c = (char) (c-32);
                System.out.println(c);
                break;
            case ('b'):
                c = (char)(c-32);
                System.out.println(c);
                break;
            case ('c'):
                c = (char)(c-32);
                System.out.println(c);
                break;
            case ('d'):
                c = (char)(c-32);
                System.out.println(c);
                break;
            default:
                System.out.println("other");
        }
    }


    /**
     * 对学生成绩大于60分的，输出“合格”。低于60分的，输出“不合格”
     */
    public static void test3() {
        System.out.println("请输入学生的成绩：");
        int grade = sc.nextInt();
        switch (grade) {

        }
    }

}
